package com.csht.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.csht.mapper.CshtTwoMenuMapper;
import com.csht.model.CshtTwoMenu;
import com.csht.service.CshtTwoMenuService;
import com.csht.vo.index.menu.CshtTwoMenuVo;
import com.csht.vo.index.shangpinzhangqu.CshtTwoMenuVo_2;

/**
 * 二级菜单service
 * @author chenhuiyan
 *
 */
@Service
public class CshtTwoMenuServiceImpl implements CshtTwoMenuService {
	
	@Autowired
	private CshtTwoMenuMapper cshtTwoMenuMapper;
	

	/**
	 * 查询二级菜单
	 */
	@Override
	public List<CshtTwoMenuVo> getTwoMenu(Integer oneMenuId) throws Exception {
		List<CshtTwoMenuVo> cshtTwoMenuVoList = cshtTwoMenuMapper.getTwoMenu(oneMenuId);
		return cshtTwoMenuVoList;
	}

	/**
	 * 有用户登录时,商品展区获取二级菜单
	 */
	@Override
	public List<CshtTwoMenuVo_2> getTTMG(Integer userId) throws Exception {
		List<CshtTwoMenuVo_2> cshtTwoMenuVo_2List =  cshtTwoMenuMapper.getTTMG(userId);
		return cshtTwoMenuVo_2List;
	}

	/**
	 * （商品展区）根据省定位改变和一级菜单id获取二级菜单
	 */
	@Override
	public List<CshtTwoMenuVo_2> getTwoByOneIdAndPosition(Integer oneMenuId) throws Exception {
		List<CshtTwoMenuVo_2> cshtTwoMenuVo_2List =  cshtTwoMenuMapper.getTwoByOneIdAndPosition(oneMenuId);
		return cshtTwoMenuVo_2List;
	}

	/**
	 * 根据一级菜单id查询二级菜单
	 */
	@Override
	public List<CshtTwoMenu> getTwoMenuByOneMenuId(Integer oneMenuId) throws Exception {
		List<CshtTwoMenu> cshtTwoMenuList = cshtTwoMenuMapper.getTwoMenuByOneMenuId(oneMenuId);
		return cshtTwoMenuList;
	}

	/**
	 * 根据三级菜单id查找二级菜单
	 */
	@Override
	public CshtTwoMenu getTwoMenuByThreeMenuId(Integer TwoMenuId) throws Exception {
		CshtTwoMenu cshtTwoMenu = cshtTwoMenuMapper.getTwoMenuByThreeMenuId(TwoMenuId);
		return cshtTwoMenu;
	}


}
